package alg;
public class Massimo {

	int secondoMax(int[] v) {
		int max = v[0];
		int smax = v[1];
		if (smax > max) {
			int t = max;
			max = smax;
			smax = t;
		}
		for (int i = 2; i < v.length; i++) {
			if (v[i] > smax) {
				if (v[i] > max) {
					smax = max;
					max = v[i];
				}
			}
		}
		return smax;
	}

}// secondoMax 
